package com.ruoyi.configManage.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.configManage.mapper.WxPayConfigMapper;
import com.ruoyi.configManage.domain.WxPayConfig;
import com.ruoyi.configManage.service.IWxPayConfigService;

/**
 * 微信支付配置Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-08-12
 */
@Service
public class WxPayConfigServiceImpl implements IWxPayConfigService 
{
    @Autowired
    private WxPayConfigMapper wxPayConfigMapper;

    /**
     * 查询微信支付配置
     * 
     * @param id 微信支付配置主键
     * @return 微信支付配置
     */
    @Override
    public WxPayConfig selectWxPayConfigById(Integer id)
    {
        return wxPayConfigMapper.selectWxPayConfigById(id);
    }

    /**
     * 查询微信支付配置列表
     * 
     * @param wxPayConfig 微信支付配置
     * @return 微信支付配置
     */
    @Override
    public List<WxPayConfig> selectWxPayConfigList(WxPayConfig wxPayConfig)
    {
        return wxPayConfigMapper.selectWxPayConfigList(wxPayConfig);
    }

    /**
     * 新增微信支付配置
     * 
     * @param wxPayConfig 微信支付配置
     * @return 结果
     */
    @Override
    public int insertWxPayConfig(WxPayConfig wxPayConfig)
    {
        wxPayConfig.setCreateTime(DateUtils.getNowDate());
        return wxPayConfigMapper.insertWxPayConfig(wxPayConfig);
    }

    /**
     * 修改微信支付配置
     * 
     * @param wxPayConfig 微信支付配置
     * @return 结果
     */
    @Override
    public int updateWxPayConfig(WxPayConfig wxPayConfig)
    {
        wxPayConfig.setUpdateTime(DateUtils.getNowDate());
        return wxPayConfigMapper.updateWxPayConfig(wxPayConfig);
    }

    /**
     * 批量删除微信支付配置
     * 
     * @param ids 需要删除的微信支付配置主键
     * @return 结果
     */
    @Override
    public int deleteWxPayConfigByIds(Integer[] ids)
    {
        return wxPayConfigMapper.deleteWxPayConfigByIds(ids);
    }

    /**
     * 删除微信支付配置信息
     * 
     * @param id 微信支付配置主键
     * @return 结果
     */
    @Override
    public int deleteWxPayConfigById(Integer id)
    {
        return wxPayConfigMapper.deleteWxPayConfigById(id);
    }
}
